package com.olc.railing.constant;

import android.content.Context;
import android.text.TextUtils;

import com.olc.railing.utils.SharedUtils;

public class Urls {
    //public static final String DOMAIN = "http://53092359.nat123.cc/ycetc.action";

    public static final String DOMAIN = "http://218.249.15.158:8887/ycetc.action";
    //

    public static final String LOCAL_DOMAIN = "http://39.104.106.82:9000";

    //挡车杆心跳上报
    public static final String PUSH_HEART = LOCAL_DOMAIN +"/api/v1/gas/data/platform/dev/status/post/";

    //查询挡车杆初始化配置
    public static final String QUERY_CONFIG = LOCAL_DOMAIN +"/api/v1/gas/data/platform/stop/dev/init/conf/";

    //挡车杆日志上报
    public static final String PUSH_LOG = LOCAL_DOMAIN+ "/api/v1/gas/data/platform/stop/dev/push/log/";

    //挡车杆更新包下载
    public static final String DOWNLOAD_APK = LOCAL_DOMAIN+ "/api/v1/gas/data/platform/dev/update/apk/";

    //获取虚拟Ukey
    public static final String FETCH_U_KEY = LOCAL_DOMAIN+ "/api/v1/gas/data/platform/dev/create/ukey/";

    //升级完成后状态更新
    public static final String UPDATE_STATUS = LOCAL_DOMAIN+ "/api/v1/gas/data/platform/dev/upgrade/status/";

    public static String getOilUrl(Context context){
      String ipAdress =  SharedUtils.getIpAdress(context);
      if(TextUtils.isEmpty(ipAdress)){
          return DOMAIN;
      }
      return "http://"+ ipAdress + ":8887/ycetc.action";
    }

}
